package com.cjm.one.payment.admin;

import com.alipay.api.AlipayApiException;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.payment.entity.AliPay;
import com.cjm.one.payment.service.PaymentInfoService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/pay/alipay")
public class adminAlipayController {
    @Resource
    private PaymentInfoService paymentInfoService;
    @PostMapping("/return")
    public Result<Boolean> returnPay(@RequestBody AliPay aliPay) throws AlipayApiException {

        return Result.ok(paymentInfoService.processRefund(aliPay));
    }
}
